import {
	ElMessage,
	ElMessageBox
} from 'element-plus';
const messageTip = {
	error(text = '错误', ) {
		ElMessage({
			message: text,
			type: 'error',
			offset: 200,
			showClose: true,
			duration: 2 * 1000
		})
	},
	warning(text = '警告') {
		ElMessage({
			message: text,
			type: 'warning',
			offset: 200,
			showClose: true,
			duration: 2 * 1000
		})
	},
	success(text = '成功') {
		ElMessage({
			message: text,
			type: 'success',
			offset: 200,
			showClose: true,
			duration: 1 * 1000
		})
	},
	info(text = '取消') {
		ElMessage({
			message: text,
			type: 'info',
			offset: 200,
			showClose: true,
			duration: 1 * 1000
		})
	},
	boxError(text = 'Box错误') {
		return ElMessageBox.confirm(text, '提示', {
			confirmButtonText: '确定',
			cancelButtonText: '取消',
			type: 'error'
		})
	},
	boxWarning(text = 'Box询问') {
		return ElMessageBox.confirm(text, '提示', {
			confirmButtonText: '确定',
			cancelButtonText: '取消',
			type: 'warning'
		})
	},
	boxSuccess(text = 'Box成功') {
		return ElMessageBox.confirm(text, '提示', {
			confirmButtonText: '确定',
			cancelButtonText: '取消',
			type: 'success'
		})
	},
	boxInfo(text = 'Box取消') {
		return ElMessageBox.confirm(text, '提示', {
			confirmButtonText: '确定',
			cancelButtonText: '取消',
			type: 'info'
		})
	}
};
export default messageTip;
